var skin = "skyblue";// dhx_terrace/dhx_web/dhx_skyblue
skin = "web";
skin = "terrace";
/**
 * 提示窗口
 */
var w_alert;
var w1;
var query;
var o=new Array();
var path = "/GX_IRAP/";
if($){
	$(function (){
		$("body").css("overflow","auto");
	});
}
var SN = {
		alert : {
				"confirm" : function(obj, func) {
					var w_alert = SN.getWindowByUrl("", 380, 220, path + "common/Alert_Confirm.jsp", {
						content : obj
					}, "w_alert");
					w_alert.hideHeader();
					w_alert.attachEvent("onClose", function(win) {
						if (func) {
							var v = win.getText();
							func.call(this, v == 1 ? true : false);
						}
						return true;
					});
				} ,
				"error" : function(obj, func) {
					var w_alert = SN.getWindowByUrl("", 380, 220, path + "common/Alert_Error.jsp", {
						content : obj
					}, "w_alert");
					w_alert.hideHeader();
					w_alert.attachEvent("onClose", function(win) {
						if (func) {
							func.call();
						}
						return true;
					});
				} ,
				"info" : function(obj, func) {
					var w_alert = SN.getWindowByUrl("", 380, 220, path + "common/Alert_Info.jsp", {
						content : obj
					}, "w_alert");
					w_alert.hideHeader();
					w_alert.attachEvent("onClose", function(win) {
						if (func) {
							func.call();
						}
						return true;
					});
				} ,
				"warning" : function(obj, func) {
					var w_alert = SN.getWindowByUrl("", 380, 220, path + "common/Alert_Warning.jsp", {
						content : obj
					}, "w_alert");
					w_alert.hideHeader();
					w_alert.attachEvent("onClose", function(win) {
						if (func) {
							func.call();
						}
						return true;
					});
				}
		} ,
		getTopWindowByUrl : function(title, w, h, url, paramsObj) {
			// API:http://docs.dhtmlx.com/api__refs__dhtmlxwindowscell.html
			var dhxWins = new dhtmlXWindows();
			w1 = dhxWins.createWindow("w1", 0, 0, w, h);
			dhxWins.attachViewportTo(top.document.body);
			w1.keepInViewport(true);
			w1.setText(title);
			w1.attachURL(url, null, paramsObj);
			w1.center();
			w1.setModal(true);
			top.w1=w1;
			return w1;
		} ,
		getWindow : function(id, title, w, h) {
			// API:http://docs.dhtmlx.com/api__refs__dhtmlxwindowscell.html
			var dhxWins = new dhtmlXWindows();
			if (id) {
				w1 = dhxWins.createWindow(id, 0, 0, w, h);
			} else {
				w1 = dhxWins.createWindow("w1", 0, 0, w, h);
			}
			// dhxWins.attachViewportTo(top);
			w1.keepInViewport(true);
			w1.setText(title);
			if (title == "") {
				// w1.hideHeader();//
			}
			// w1.progressOn();//
			// w1.progressOff();//
			// w1.clearIcon();
//			w1.allowResize();// 允许改变大小
			 w1.denyResize();// 允许改变大小
			// w1.denyMove();//
			// w1.allowMove();//
			// w1.allowPark();//
			// w1.denyPark();//
			// w1.button("close").disable();//
			// w1.button("close").hide();//
			// w1.button("close").show();//
			w1.button("help").disable();//
			// w1.button("help").hide();//
			// w1.button("help").show();//
			w1.button("stick").disable();//
			w1.button("stick").hide();//
			// w1.button("stick").show();//
			w1.button("park").disable();//
			w1.button("park").hide();//
			// w1.button("park").show();//
			// w1.button("minmax").disable();//
			// w1.button("minmax").hide();//
			w1.button("minmax").show();//
			// w1.showHeader();//
			// w1.hideHeader();//
			// w1.show();//
			// w1.hide();//
			// w1.maximize();//
			// w1.minimize();//
			w1.center();
			w1.setModal(true);
			return w1;
		} ,
		getWindowByUrl : function(title, w, h, url, paramsObj, id) {
			id = "w1";
			var w1 = SN.getWindow(id, title, w, h);
			w1.attachURL(url, null, paramsObj);
			return w1;
		}
};
